package com.hydl.power.controller;

import com.hydl.power.pojo.ElectricityBill;
import com.hydl.power.service.ElectricityFeesService;
import com.hydl.power.utils.Resp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(value = "ElectricityFeesController",tags = "电费")
@RequestMapping("/electricityFees")
@RestController
@CrossOrigin
public class ElectricityFeesController {


    @Autowired
    private ElectricityFeesService electricityFeesService;


    @ApiOperation("---查询单个变压器每月电费/总电费")
    @PostMapping("/getTransformerElectricityBill")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getTransformerElectricityBill(String projectId,String deviceId,String time){
        Map<String, Object> map = electricityFeesService.getTransformerElectricityBill(projectId, deviceId, time);
        return Resp.success(map);
    }

    @ApiOperation("---查询项目每月电费/总电费")
    @PostMapping("/getElectricityBillProject")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getElectricityBillProject(String projectId,String time){
        Map<String, Object> map= electricityFeesService.getElectricityBillProject(projectId, time);
        return Resp.success(map);
    }


    @ApiOperation("---查询单个变压器每月力调电费/总力调电费")
    @PostMapping("/getTransformerElectricityFees")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getTransformerElectricityFees(String projectId,String deviceId,String time){
        Map<String, Object> map = electricityFeesService.getTransformerElectricityFees(projectId,deviceId,time);
        return Resp.success(map);
    }


    @ApiOperation("---查询项目每月力调电费/总力调电费")
    @PostMapping("/getElectricityFeesProject")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getElectricityFeesProject(String projectId,String time){
        Map<String, Object> map = electricityFeesService.getElectricityFeesProject(projectId, time);
        return Resp.success(map);
    }





/*

    @ApiOperation("查询单个变压器每月电费")
    @PostMapping("/getMonthElectricityBill")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getMonthElectricityBill(String projectId,String deviceId,String time){
        List<ElectricityBill>  list = electricityFeesService.getMonthElectricityBill(projectId,deviceId,time);
        return Resp.success(list);
    }


    @ApiOperation("查询单个变压器一年电费")
    @PostMapping("/getElectricityBill")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getElectricityBill(String projectId,String deviceId,String time){
        ElectricityBill electricityBill = electricityFeesService.getElectricityBill(projectId, deviceId, time);
        return Resp.success(electricityBill);
    }


    @ApiOperation("查询项目每月电费")
    @PostMapping("/getProjectMonthElectricityBill")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getProjectMonthElectricityBill(String projectId,String time){
        List<ElectricityBill> list = electricityFeesService.getProjectMonthElectricityBill(projectId, time);
        return Resp.success(list);
    }

    @ApiOperation("查询项目每月力调电费")
    @PostMapping("/getProjectMonthElectricityFees")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getProjectMonthElectricityFees(String projectId,String time){
        List<ElectricityBill> list = electricityFeesService.getProjectMonthElectricityFees(projectId, time);
        return Resp.success(list);
    }


    @ApiOperation("查询项目一年总电费")
    @PostMapping("/getProjectElectricityBill")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getProjectElectricityBill(String projectId,String time){
        ElectricityBill electricityBill = electricityFeesService.getProjectElectricityBill(projectId, time);
        return Resp.success(electricityBill);
    }

    @ApiOperation("查询项目一年总力调电费")
    @PostMapping("/getProjectElectricityFees")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getProjectElectricityFees(String projectId,String time){
        ElectricityBill electricityBill = electricityFeesService.getProjectElectricityFees(projectId, time);
        return Resp.success(electricityBill);
    }




    @ApiOperation("查询单个变压器每月力调电费")
    @PostMapping("/getMonthElectricityFees")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getMonthElectricityFees(String projectId,String deviceId,String time){
        List<ElectricityBill>  list = electricityFeesService.getMonthElectricityFees(projectId,deviceId,time);
        return Resp.success(list);
    }

    @ApiOperation("查询单个变压器一年总力调电费")
    @PostMapping("/getElectricityFees")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "projectId", value = "项目id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "deviceId", value = "设备id" , dataType = "String"),
            @ApiImplicitParam(paramType = "query", name = "time", value = "年份" , dataType = "String"),
    })
    public Resp getElectricityFees(String projectId,String deviceId,String time){
        ElectricityBill  electricityBill = electricityFeesService.getElectricityFees(projectId,deviceId,time);
        return Resp.success(electricityBill);
    }
*/


}
